]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
extensionSystem: Fix reloading on version-validation changes
authorFlorian Müllner <fmuellner@gnome.org>
Sat, 6 Sep 2014 14:30:59 +0000 (16:30 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Sat, 6 Sep 2014 20:06:07 +0000 (22:06 +0200)
The current code only works for enabled extensions, which means
that extensions that were marked OUT_OF_DATE cannot be enabled
without a restart when disabling the version check.
Fix this by reloading all extensions while making sure to only
enable any extensions when we're supposed to.

https://bugzilla.gnome.org/show_bug.cgi?id=736185

js/ui/extensionSystem.js

index 3f0e1709c1509bcb0d75364cef0ef81d5e3aab51..11a75c65e950166508a87b0531272da807f0d58b 100644 (file)
@@ -271,10 +271,17 @@ function onEnabledExtensionsChanged() {
 }
 
 function _onVersionValidationChanged() {
+    // we want to reload all extensions, but only enable
+    // extensions when allowed by the sessionMode, so
+    // temporarily disable them all
+    enabledExtensions = [];
+    for (let uuid in ExtensionUtils.extensions)
+        reloadExtension(ExtensionUtils.extensions[uuid]);
+    enabledExtensions = getEnabledExtensions();
+
     if (Main.sessionMode.allowExtensions) {
         enabledExtensions.forEach(function(uuid) {
-            if (ExtensionUtils.extensions[uuid])
-                reloadExtension(ExtensionUtils.extensions[uuid]);
+            enableExtension(uuid);
         });
     }
 }